import request from '../interceptor'

/**
 * 获取点选验证码
 */
export const getTapCaptcha = {
  baseUrl: `/public/tapCaptcha`,
  method: 'get',
  request: () =>
    request({
      url: `/public/tapCaptcha`,
    }),
}

/**
 * 校验点选验证码
 */
export const PostTapCaptcha = {
  baseUrl: `/public/tapCaptcha/verify`,
  method: 'post',
  request: (data: { xyArr: { x: number; y: number }[] }) =>
    request({
      url: `/public/tapCaptcha/verify`,
      method: 'post',
      data,
    }),
}

/**
 * 登录-点选验证码
 */
export const loginV2 = {
  baseUrl: `/public/tapCaptcha/login`,
  method: 'post',
  request: (data: { account: string; password: string }) =>
    request({
      url: `/public/tapCaptcha/login`,
      method: 'post',
      data,
    }),
}
